; Realize adding 10 64-bits-unsigned numbers

	area add, code, readonly   
	entry    
	code32   
start
	ldr r0, =nums		;Add numbers        
	mov r1, #0			          
	ldr r2, =result		;The result one      
	mov r3, #0   
	mov r4, #0   
	mov r6, #0   
	mov r5, #10   
loop
	ldr r3, [r0]		;This is low 32-bits         
	add r0, r0, #4   
	ldr r1, [r0]		;This is high 32-bits         
	add r0, r0, #4   
	adds r4, r4, r3		;Add low 32bits, change cpsr       
	adcs r6, r6, r1		;Add high 32bits and carry bit      
	sub r5, r5, #1   
	cmp r5, #0   
	bne loop   
	str r4, [r2]   
	add r2, r2, #4   
	str r6, [r2]  
	   
stop
	mov r0, #0x18   
	ldr r1, =0x20026   
	swi 0x123456   
nums	dcd	0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0   
result	dcd 0,0 
    end